package com.roncoo.eshop.dao.impl;

import com.roncoo.eshop.dao.RedisDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Repository;

@Repository("redisDAO")
public class RedisDAOImpl implements RedisDAO {

    @Autowired
    RedisTemplate<String, String> redisTemplate;


    @Override
    public void set(String key, String value) {
        redisTemplate.opsForValue().set(key, value);
    }

    @Override
    public String get(String key) {
        return redisTemplate.boundValueOps(key).get();
    }

    @Override
    public void delete(String key) {
        redisTemplate.delete(key);
    }

}
